/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace EffiProz.Designer.Design
{
  using System;
  using System.Collections.Generic;
  using System.Text;
  using System.ComponentModel;
  using System.Data;
  using System.Data.Common;

  internal class PrimaryKey : Index, ICloneable
  {
 

    internal PrimaryKey(DbConnection cnn, Table table, DataRow row)
      : base(cnn, table, row)
    {
   
    }

    protected PrimaryKey(PrimaryKey source)
      : base(source)
    {
      
    }

    public override IndexTypeEnum IndexType
    {
      get
      {
        return IndexTypeEnum.PrimaryKey;
      }
    }

    protected override string NamePrefix
    {
      get
      {
        return "PK";
      }
    }

    protected override string NewName
    {
      get
      {
        return Table.Name;
      }
    }

    [Browsable(false)]
    public override bool Unique
    {
      get
      {
        return true;
      }
      set
      {
        base.Unique = true;
      }
    }   
 

    #region ICloneable Members

    object ICloneable.Clone()
    {
      return new PrimaryKey(this);
    }

    #endregion
  }
}
